//NO USE !!!!!
//For code copy !!!!!

//此类用于代码拷贝。（未实现直接调用）
//用法：生成背景label，生成菜单按钮，生成正常按钮，生成矮按钮，生成方形按钮，生成外框按钮
var widgetTemplate = {
	_CreateBackgroundLabel : function(text,xpos,ypos){
		var label = cc.labelTTF.create(text, "simhei", 36);
		label.attr({x:xpos, y:ypos});
		var labelBackground = new cc.Sprite(resource.white1010_png);
		labelBackground.attr({
			x : 0.5 * label.width,
			y : 0.5 * label.height,
			color : cc.color(0,0,0),
			opacity : 128,
			scaleX : (label.width + 20) * 0.1,
			scaleY : (label.height + 20) * 0.1,
		});
		label.addChild(labelBackground, -1);
		return label;
	},
	_CreateMenuButton : function(xpos,ypos,text,callback){
		var button = new cc.MenuItemImage(resource.menubtnNormal_png,resource.menubtnDown_png, resource.menubtnDisable_png, callback, this);
		button.attr({x: xpos, y: ypos});
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.attr({x: button.width * 0.5, y: button.height * 0.5});
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	},
	_CreateNormalButton : function(text,xpos,ypos,callback){
		var button = new cc.MenuItemImage(resource.ctrlbtnNormal_png,resource.ctrlbtnDown_png, resource.ctrlbtnDisable_png, callback, this);
		button.setPosition(xpos, ypos);
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.setPosition(button.width * 0.5, button.height * 0.5);
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	},
	_CreateShortButton : function(text,xpos,ypos,callback){
		var button = new cc.MenuItemImage(resource.ctrlbtnNormalS_png,resource.ctrlbtnDownS_png, resource.ctrlbtnDisableS_png, callback, this);
		button.setPosition(xpos, ypos);
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.setPosition(button.width * 0.5, button.height * 0.5);
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	},
	_CreateVerticalButton : function(text,xpos,ypos,callback){
		var button = new cc.MenuItemImage(resource.ctrlbtnNormalV_png,resource.ctrlbtnDownV_png, resource.ctrlbtnDisableV_png, callback, this);
		button.setPosition(xpos, ypos);
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.setPosition(button.width * 0.5, button.height * 0.5);
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	},
	_CreateSquareButton : function(text,xpos,ypos){
		var button = new cc.MenuItemImage(resource.ctrlbtnNormalZ_png,resource.ctrlbtnDownZ_png, resource.ctrlbtnDisableZ_png);
		button.setPosition(xpos, ypos);
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.setPosition(button.width * 0.5, button.height * 0.5);
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	},
	_CreateOutlineButton : function(text,xpos,ypos,callback){
		var button = new cc.MenuItemImage(resource.ctrlbtnNormalR_png,resource.ctrlbtnDownR_png, resource.ctrlbtnDisableR_png, callback, this);
		button.setPosition(xpos, ypos);
		var label = cc.LabelTTF.create(text, "simhei", 28);
		label.setPosition(button.width * 0.5, button.height * 0.5);
		label.setColor(cc.color(0,0,0));
		button.addChild(label);
		return button;
	}
}